//
// Created by iguilty on 2022-01-13.
//

#include "Decorator.h"
#include <iostream>
using namespace std;

Component::Component() {}
Component::~Component() {}

void Component::Operation() {}
ConcreteComponent::ConcreteComponent() {}
ConcreteComponent::~ConcreteComponent() {}
void ConcreteComponent::Operation() {
    cout<<"ConcreteComponent operation..."<<endl;
}

Decorator::Decorator(Component *component) {
    this->_component = component;
}

Decorator::~Decorator() {
    delete _component;
}

void Decorator::Operation() {}

ConcreteDecorator::ConcreteDecorator(Component *component): Decorator(component) {

}

ConcreteDecorator::~ConcreteDecorator(){}

void ConcreteDecorator::AddedBehavior() {
    cout<<"ConcreteDecorator::AddedBehavior"<<endl;
}

void ConcreteDecorator::Operation() {
    _component->Operation();
    this->AddedBehavior();
}









